//
//  Programme_DetailViewController.m
//  fxxiaoke
//
//  Created by 鞠超 on 2016/10/28.
//  Copyright © 2016年 jc. All rights reserved.
//

#import "Programme_DetailViewController.h"

#import "Personal_InformationViewController.h"
#import "Person_listViewController.h"
#import "Date_listViewController.h"
#import "Programme_DetailTableViewCell.h"
#import "Reply_detailViewController.h"

@interface Programme_DetailViewController () <UITableViewDelegate, UITableViewDataSource>

@property (nonatomic, strong) UIView * view_bottom;

@property (nonatomic, strong) UITableView * tableView;
//第一部分
@property (nonatomic, strong) UIImageView * image_Head;
@property (nonatomic, strong) UILabel * name;
@property (nonatomic, strong) UILabel * time;
@property (nonatomic, strong) UILabel * equipment;
@property (nonatomic, strong) UILabel * type;

@property (nonatomic, strong) UIView * view_blue;
@property (nonatomic, strong) UILabel * scope_detail;
@property (nonatomic, strong) UILabel * text_detail;

@property (nonatomic, strong) UILabel * date;
@property (nonatomic, strong) UILabel * person;
@property (nonatomic, strong) UILabel * remind;
//第二部分
@property (nonatomic, strong) UIButton * btn_reply;
@property (nonatomic, strong) UIButton * btn_support;
@property (nonatomic, strong) UIView * view_Oline;
@property (nonatomic, assign) BOOL is_reply;

@end

@implementation Programme_DetailViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self p_navi];
    
    [self p_bottomView];
    
    [self p_setupView];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - navi
- (void )p_navi
{
    _btnLeft.hidden = YES;
    _lblLeft.hidden = YES;
    _btnRight.hidden = YES;
    _lblRight.hidden = YES;
    
    _lblTitle.text = @"日程";
    _topView.backgroundColor = navi_bar_bg_color;
    
    //左返回
    UIImageView * image_LeftRetrun = [[UIImageView alloc] initWithFrame:CGRectMake(11, 31.5, 25, 25)];
    image_LeftRetrun.userInteractionEnabled = YES;
    image_LeftRetrun.image = [UIImage imageNamed:@"Left-return.png"];
    [_topView addSubview:image_LeftRetrun];
    
    UILabel * lbl_return = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(image_LeftRetrun.frame) - 6, 35, 100, 15)];
    lbl_return.text = @"2026年09月";
    lbl_return.textColor = [UIColor whiteColor];
    lbl_return.font = [UIFont systemFontOfSize:17];
    [_topView addSubview:lbl_return];
    
    UIButton * btn_return = [UIButton buttonWithType:(UIButtonTypeSystem)];
    btn_return.frame = CGRectMake(10, 22, 100, 40);
    [_topView addSubview:btn_return];
    [btn_return addTarget:self action:@selector(btn_returnAction:) forControlEvents:(UIControlEventTouchUpInside)];
}

//左返回
- (void )btn_returnAction:(UIButton *)sender
{
    [self.navigationController popViewControllerAnimated:YES];
}

//显示tabbar
- (void )viewWillAppear:(BOOL)animated
{
    [(AppDelegate *)[[UIApplication sharedApplication] delegate] hiddenTabBar];
}

#pragma mark - 布局
- (void )p_setupView
{
    self.view.backgroundColor = [UIColor whiteColor];
    
    self.tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 64, SCREEN_WIDTH, SCREEN_HEIGHT - 64 - 50) style:(UITableViewStylePlain)];
    self.tableView.backgroundColor = [UIColor whiteColor];
    self.tableView.dataSource = self;
    self.tableView.delegate = self;
    self.tableView.tableFooterView = [[UIView alloc] init];
    self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    [self.view addSubview:self.tableView];
    
    //注册
    [self.tableView registerClass:[Programme_DetailTableViewCell class] forCellReuseIdentifier:@"cell_comment"];
}

#pragma mark - tableview代理
- (NSInteger )numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}

- (NSInteger )tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    if(self.is_reply == 0)
    {
        return 2 + 3;
    }
    else
    {
        return 3;
    }
}

- (CGFloat )tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    if(self.is_reply == 0)
    {
        if(indexPath.row == 0)
        {
            return 370.0f;
        }
        else if (indexPath.row == 1)
        {
            return 42.0f;
        }
        else
        {
            CGFloat length_x = [@"数据库及的会计师会计会计师的快速健康的监控及深刻的健康时数据库及的会计师会计会计师的快速健康的监控及深刻的健康时数据库及的会计师会计会计师的快速健康的监控及深刻的健康时数据库及的会计师会计会计师的快速健康的监控及深刻的健康时间段看" boundingRectWithSize:CGSizeMake(SCREEN_WIDTH - 62 - 20, 10000)    options:(NSStringDrawingUsesLineFragmentOrigin) attributes:@{NSFontAttributeName : [UIFont systemFontOfSize:17.0f]} context:nil].size.height;
            
            return 100 + length_x;
        }
    }
    else
    {
        if(indexPath.row == 0)
        {
            return 370.0f;
        }
        else if (indexPath.row == 1)
        {
            return 42.0f;
        }
        else
        {
            return 350.0f;
        }
    }
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell * cell = [[UITableViewCell alloc] init];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    
    if(indexPath.row == 0)
    {
        //
        self.image_Head = [[UIImageView alloc] initWithFrame:CGRectMake(15, 20, 45, 45)];
        self.image_Head.layer.cornerRadius = 22.5;
        self.image_Head.layer.masksToBounds = YES;
        self.image_Head.image = [UIImage imageNamed:@"heads.jpg"];
        [cell addSubview:self.image_Head];
        
        //
        self.name = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.image_Head.frame) + 10, 24, SCREEN_WIDTH / 2, 17)];
        self.name.text = @"员工名称";
        self.name.font = [UIFont systemFontOfSize:17.0f];
        [cell addSubview:self.name];
        
        //
        self.time = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.image_Head.frame) + 10, CGRectGetMaxY(self.name.frame) + 5, 80, 15)];
        self.time.text = @"昨天 09:36";
        self.time.textColor = [UIColor grayColor];
        self.time.font = [UIFont systemFontOfSize:14.0f];
        [cell addSubview:self.time];
        
        //
        self.equipment = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.time.frame), CGRectGetMaxY(self.name.frame) + 5, 85, 15)];
        self.equipment.text = @"来自iPhone";
        self.equipment.textColor = [UIColor grayColor];
        self.equipment.font = [UIFont systemFontOfSize:14.0f];
        [cell addSubview:self.equipment];

        //
        self.type = [[UILabel alloc] initWithFrame:CGRectMake(SCREEN_WIDTH - 10 - 50,  30, 50, 15)];
        self.type.text = @"日程";
        self.type.textAlignment = NSTextAlignmentRight;
        self.type.textColor = [UIColor grayColor];
        self.type.font = [UIFont systemFontOfSize:14.0f];
        [cell addSubview:self.type];
        
        //
        self.view_blue = [[UIView alloc] init];
        self.view_blue.frame = CGRectMake(15, CGRectGetMaxY(self.image_Head.frame) + 15, 150, 25);
        self.view_blue.layer.cornerRadius = 12;
        self.view_blue.backgroundColor = [UIColor whiteColor];
        self.view_blue.layer.borderColor = [UIColor colorWithRed:90/255.0 green:167/255.0 blue:239/255.0 alpha:1.0].CGColor;
        self.view_blue.layer.borderWidth = 1.0f;
        [cell addSubview:self.view_blue];
        
        //
        UIImageView * image_earth = [[UIImageView alloc] initWithFrame:CGRectMake(5, 2.5, 20, 20)];
        image_earth.layer.masksToBounds = YES;
        image_earth.layer.cornerRadius = 10;
        image_earth.image = [UIImage imageNamed:@"Earth_blue.png"];
        [self.view_blue addSubview:image_earth];
        
        //
        self.scope_detail = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(image_earth.frame) + 5, 5, 120, 15)];
        self.scope_detail.text = @"抄送范围: 全公司";
        self.scope_detail.textColor = [UIColor colorWithRed:90/255.0 green:167/255.0 blue:239/255.0 alpha:1.0];
        self.scope_detail.font = [UIFont systemFontOfSize:15.0f];
        [self.view_blue addSubview:self.scope_detail];
        
        
        CGFloat length_x = [@"是的会计师的会计师空间打开手机端快捷斯柯达是基督教是基督教就是看到精神可嘉" boundingRectWithSize:CGSizeMake(SCREEN_WIDTH - 30, 10000)    options:(NSStringDrawingUsesLineFragmentOrigin) attributes:@{NSFontAttributeName : [UIFont systemFontOfSize:17.0f]} context:nil].size.height;
        //
        self.text_detail = [[UILabel alloc] initWithFrame:CGRectMake(15, CGRectGetMaxY(self.view_blue.frame) + 10, SCREEN_WIDTH - 30, length_x)];
        self.text_detail.text = @"是的会计师的会计师空间打开手机端快捷斯柯达是基督教是基督教就是看到精神可嘉";
        self.text_detail.font = [UIFont systemFontOfSize:17.0f];
//        self.text_detail.backgroundColor = [UIColor groupTableViewBackgroundColor];
        self.text_detail.numberOfLines = 0;
        [cell addSubview:self.text_detail];
        
#pragma mark - 3个
        //
        UIView * view_Line = [[UIView alloc] initWithFrame:CGRectMake(7, CGRectGetMaxY(self.text_detail.frame) + 15, SCREEN_WIDTH - 7, 1)];
        view_Line.backgroundColor = [UIColor grayColor];
        view_Line.alpha = 0.4f;
        [cell addSubview:view_Line];

        //1
        UIImageView * image_icon1 = [[UIImageView alloc] initWithFrame:CGRectMake(15, CGRectGetMaxY(view_Line.frame) + 15, 20, 20)];
        image_icon1.image = [UIImage imageNamed:@"involvement_blue.png"];
        image_icon1.layer.masksToBounds = YES;
        [cell addSubview:image_icon1];

        //
        UILabel * name1 = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(image_icon1.frame) + 10, CGRectGetMaxY(view_Line.frame) + 15, 50, 20)];
        name1.text = @"参与人";
        name1.textColor = [UIColor grayColor];
        name1.font = [UIFont systemFontOfSize:15.0f];
        [cell addSubview:name1];
        
        //
        UIImageView * icon_return1 = [[UIImageView alloc] init];
        icon_return1.layer.masksToBounds = YES;
        icon_return1.frame = CGRectMake(SCREEN_WIDTH - 10 - 20, CGRectGetMaxY(view_Line.frame) + 15, 20, 20);
        icon_return1.image = [UIImage imageNamed:@"rigth-return.png"];
        [cell addSubview:icon_return1];

        //
        self.person = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(name1.frame) + 30, CGRectGetMaxY(view_Line.frame) + 15, SCREEN_WIDTH - CGRectGetMaxX(name1.frame) - 30 - 30 - 10, 20)];
        self.person.text = @"全公司员工参与";
        self.person.font = [UIFont systemFontOfSize:15.0f];
        [cell addSubview:self.person];

        //
        UIView * view_Line1 = [[UIView alloc] initWithFrame:CGRectMake(CGRectGetMaxX(image_icon1.frame) + 10, CGRectGetMaxY(view_Line.frame) + 49, SCREEN_WIDTH - 15, 1)];
        view_Line1.backgroundColor = [UIColor grayColor];
        view_Line1.alpha = 0.4f;
        [cell addSubview:view_Line1];
        
        //2
        UIImageView * image_icon2 = [[UIImageView alloc] initWithFrame:CGRectMake(15, CGRectGetMaxY(view_Line1.frame) + 15, 20, 20)];
        image_icon2.image = [UIImage imageNamed:@"time_blue.png"];
        image_icon2.layer.masksToBounds = YES;
        [cell addSubview:image_icon2];
        
        //
        UILabel * name2 = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(image_icon2.frame) + 10, CGRectGetMaxY(view_Line1.frame) + 15, 70, 20)];
        name2.text = @"截止日期";
        name2.textColor = [UIColor grayColor];
        name2.font = [UIFont systemFontOfSize:15.0f];
        [cell addSubview:name2];

        //
        UIImageView * icon_return2 = [[UIImageView alloc] init];
        icon_return2.layer.masksToBounds = YES;
        icon_return2.frame = CGRectMake(SCREEN_WIDTH - 10 - 20, CGRectGetMaxY(view_Line1.frame) + 15, 20, 20);
        icon_return2.image = [UIImage imageNamed:@"rigth-return.png"];
        [cell addSubview:icon_return2];

        //
        self.person = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(name1.frame) + 30, CGRectGetMaxY(view_Line1.frame) + 15, SCREEN_WIDTH - CGRectGetMaxX(name1.frame) - 30 - 30 - 10, 20)];
        self.person.text = @"2016年09月09日 09:09";
        self.person.font = [UIFont systemFontOfSize:15.0f];
        [cell addSubview:self.person];

        //
        UIView * view_Line2 = [[UIView alloc] initWithFrame:CGRectMake(CGRectGetMaxX(image_icon2.frame) + 10, CGRectGetMaxY(view_Line1.frame) + 49, SCREEN_WIDTH - 15, 1)];
        view_Line2.backgroundColor = [UIColor grayColor];
        view_Line2.alpha = 0.4f;
        [cell addSubview:view_Line2];
        
        //3
        UIImageView * image_icon3 = [[UIImageView alloc] initWithFrame:CGRectMake(15, CGRectGetMaxY(view_Line2.frame) + 15, 20, 20)];
        image_icon3.image = [UIImage imageNamed:@"involvement_blue.png"];
        image_icon3.layer.masksToBounds = YES;
        [cell addSubview:image_icon3];
        
        //
        UILabel * name3 = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(image_icon3.frame) + 10, CGRectGetMaxY(view_Line2.frame) + 15, 50, 20)];
        name3.text = @"提醒";
        name3.textColor = [UIColor grayColor];
        name3.font = [UIFont systemFontOfSize:15.0f];
        [cell addSubview:name3];

        //
        UIImageView * icon_return3 = [[UIImageView alloc] init];
        icon_return3.layer.masksToBounds = YES;
        icon_return3.frame = CGRectMake(SCREEN_WIDTH - 10 - 20, CGRectGetMaxY(view_Line2.frame) + 15, 20, 20);
        icon_return3.image = [UIImage imageNamed:@"rigth-return.png"];
        [cell addSubview:icon_return3];
        
        //
        self.remind = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(name3.frame) + 30, CGRectGetMaxY(view_Line2.frame) + 15, SCREEN_WIDTH - CGRectGetMaxX(name3.frame) - 30 - 30 - 10, 20)];
        self.remind.text = @"事件发生时";
        self.remind.font = [UIFont systemFontOfSize:15.0f];
        [cell addSubview:self.remind];
        
        //
        UIView * view_Line3 = [[UIView alloc] initWithFrame:CGRectMake(CGRectGetMaxX(image_icon3.frame) + 10, CGRectGetMaxY(view_Line2.frame) + 49, SCREEN_WIDTH - 15, 1)];
        view_Line3.backgroundColor = [UIColor grayColor];
        view_Line3.alpha = 0.4f;
        [cell addSubview:view_Line3];
        
        UIView * view_Line4 = [[UIView alloc] initWithFrame:CGRectMake(0, 360, SCREEN_WIDTH, 10)];
        view_Line4.backgroundColor = [UIColor groupTableViewBackgroundColor];
        [cell addSubview:view_Line4];
        
        //点击进入个人资料
        UIButton * btn_user = [UIButton buttonWithType:(UIButtonTypeSystem)];
        btn_user.frame = CGRectMake(10, 15, SCREEN_WIDTH - 20, 60);
        [cell addSubview:btn_user];
        [btn_user addTarget:self action:@selector(btn_userAction:) forControlEvents:(UIControlEventTouchUpInside)];
        
        //1
        UIButton * btn_preson = [UIButton buttonWithType:(UIButtonTypeSystem)];
        btn_preson.frame = CGRectMake(0, CGRectGetMinY(view_Line.frame), SCREEN_WIDTH, 50);
        [cell addSubview:btn_preson];
        [btn_preson addTarget:self action:@selector(btn_presonAction:) forControlEvents:(UIControlEventTouchUpInside)];
        
        //2
        UIButton * btn_date = [UIButton buttonWithType:(UIButtonTypeSystem)];
        btn_date.frame = CGRectMake(0, CGRectGetMaxY(btn_preson.frame), SCREEN_WIDTH, 50);
        [cell addSubview:btn_date];
        [btn_date addTarget:self action:@selector(btn_dateAction:) forControlEvents:(UIControlEventTouchUpInside)];
        
        //3
        UIButton * btn_remind = [UIButton buttonWithType:(UIButtonTypeSystem)];
        btn_remind.frame = CGRectMake(0, CGRectGetMaxY(btn_date.frame), SCREEN_WIDTH, 50);
//        btn_remind.backgroundColor = [UIColor groupTableViewBackgroundColor];
        [cell addSubview:btn_remind];
        [btn_remind addTarget:self action:@selector(btn_remindAction:) forControlEvents:(UIControlEventTouchUpInside)];
    }
    else if (indexPath.row == 1)
    {
        UIView * view_bg = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 42)];
        view_bg.backgroundColor = [UIColor groupTableViewBackgroundColor];
        view_bg.alpha = 0.6f;
        [cell addSubview:view_bg];
        
        //
        self.btn_reply = [UIButton buttonWithType:(UIButtonTypeCustom)];
        self.btn_reply.frame = CGRectMake(15, 0, 66, 40);
        [self.btn_reply setTitle:@"回复(10)" forState:(UIControlStateNormal)];
        [self.btn_reply setTitleColor:[UIColor blackColor] forState:(UIControlStateNormal)];
        self.btn_reply.titleLabel.font = [UIFont systemFontOfSize:17.0f];
        self.btn_reply.titleLabel.textAlignment = NSTextAlignmentLeft;
        [cell addSubview:self.btn_reply];
        [self.btn_reply addTarget:self action:@selector(btn_ReplyNumberAction:) forControlEvents:(UIControlEventTouchUpInside)];
        
        //
        self.btn_support = [UIButton buttonWithType:(UIButtonTypeCustom)];
        self.btn_support.frame = CGRectMake(CGRectGetMaxX(self.btn_reply.frame) + 10, 10, 66, 20);
        [self.btn_support setTitle:@"赞(0)" forState:(UIControlStateNormal)];
        [self.btn_support setTitleColor:[UIColor blackColor] forState:(UIControlStateNormal)];
        self.btn_support.titleLabel.font = [UIFont systemFontOfSize:17.0f];
        self.btn_support.titleLabel.textAlignment = NSTextAlignmentLeft;
        [cell addSubview:self.btn_support];
        [self.btn_support addTarget:self action:@selector(btn_supportNumberAction:) forControlEvents:(UIControlEventTouchUpInside)];

        //
        self.view_Oline = [[UIView alloc] init];
        self.view_Oline.backgroundColor = [UIColor orangeColor];
        [cell addSubview:self.view_Oline];
        
        if(self.is_reply == 0)
        {
            self.view_Oline.frame = CGRectMake(15, 40, 66, 2);
        }
        else
        {
            self.view_Oline.frame = CGRectMake(91, 40, 66, 2);
        }
    }
    else
    {//留着后面
        if(self.is_reply == 0)
        {
            Programme_DetailTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:@"cell_comment" forIndexPath:indexPath];
            cell.selectionStyle = UITableViewCellSelectionStyleNone;
            
            cell.btn_support.tag = 1000 + indexPath.row;
            [cell.btn_support addTarget:self action:@selector(btn_supportClickAction:) forControlEvents:(UIControlEventTouchUpInside)];
            
            cell.btn_reply.tag = 3000 + indexPath.row;
            [cell.btn_reply addTarget:self action:@selector(btn_replyClickAction:) forControlEvents:(UIControlEventTouchUpInside)];
            
            return cell;
        }
        else
        {
            UITableViewCell * cell = [[UITableViewCell alloc] init];
            cell.selectionStyle = UITableViewCellSelectionStyleNone;
            cell.backgroundColor = [UIColor groupTableViewBackgroundColor];
            
            
            UIView * view_white = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 150)];
            view_white.backgroundColor = [UIColor whiteColor];
            [cell addSubview:view_white];
            
            return cell;
        }
    }
    
    return cell;
}

#pragma mark - 点赞
- (void )btn_supportClickAction:(UIButton *)sender
{
    NSLog(@"点赞");
}

#pragma mark - 点击回复
- (void )btn_replyClickAction:(UIButton *)sender
{
//    NSLog(@"点击回复");
    
    Reply_detailViewController * reply_detailViewController = [[Reply_detailViewController alloc] init];
    reply_detailViewController.str_replyName = @"员工名字";
    
    [self showViewController:reply_detailViewController sender:nil];
}

#pragma mark - 点击切换 **********************************
//回复数
- (void )btn_ReplyNumberAction:(UIButton *)sender
{
    [UIView animateWithDuration:0.3f animations:^{
        
        self.view_Oline.frame = CGRectMake(15, 40, 66, 2);
        self.is_reply = 0;
        
    } completion:^(BOOL finished) {
        
        dispatch_async(dispatch_get_main_queue(), ^{
            //刷新tableView(记住,要更新放在主线程中)
            [self.tableView reloadData];
        });
    }];
}

//点赞数
- (void )btn_supportNumberAction:(UIButton *)sender
{
    [UIView animateWithDuration:0.3f animations:^{
        
        self.view_Oline.frame = CGRectMake(91, 40, 66, 2);
        self.is_reply = 1;
        
    } completion:^(BOOL finished) {
        
        dispatch_async(dispatch_get_main_queue(), ^{
            //刷新tableView(记住,要更新放在主线程中)
            [self.tableView reloadData];
        });
        
    }];
}

#pragma mark - 底部视图  **********************************
- (void )p_bottomView
{
    UIView * view_Line = [[UIView alloc] initWithFrame:CGRectMake(0, SCREEN_HEIGHT - 50, SCREEN_WIDTH, 1)];
    view_Line.backgroundColor = [UIColor grayColor];
    view_Line.alpha = 0.4f;
    [self.view addSubview:view_Line];
    
    self.view_bottom = [[UIView alloc] initWithFrame:CGRectMake(0, SCREEN_HEIGHT - 49, SCREEN_WIDTH, 49)];
    self.view_bottom.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:self.view_bottom];
    
    
    CGFloat length_x = SCREEN_WIDTH / 4;
    
    //回复
    UIImageView * image_Reply = [[UIImageView alloc] initWithFrame:CGRectMake(length_x / 5, 15, 20, 20)];
    image_Reply.image = [UIImage imageNamed:@"reply_gray.png"];
    image_Reply.layer.masksToBounds = YES;
    [self.view_bottom addSubview:image_Reply];
    
    UILabel * lbl_Reply = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(image_Reply.frame) + 5, 15, 40, 20)];
    lbl_Reply.text = @"回复";
    lbl_Reply.textColor = [UIColor grayColor];
    lbl_Reply.font = [UIFont systemFontOfSize:15.0f];
    [self.view_bottom addSubview:lbl_Reply];
    
    UIView * line_Reply = [[UIView alloc] initWithFrame:CGRectMake(length_x, 15, 0.7, 23)];
    line_Reply.backgroundColor = [UIColor grayColor];
    line_Reply.alpha = 0.4f;
    [self.view_bottom addSubview:line_Reply];
    
    UIButton * btn_Reply = [UIButton buttonWithType:(UIButtonTypeCustom)];
    btn_Reply.frame = CGRectMake(0, 0, length_x, 49);
    [self.view_bottom addSubview:btn_Reply];
    [btn_Reply addTarget:self action:@selector(btn_ReplyAction:) forControlEvents:(UIControlEventTouchUpInside)];
    
    //赞
    UIImageView * image_Assist = [[UIImageView alloc] initWithFrame:CGRectMake(length_x + length_x / 4, 15, 20, 20)];
    image_Assist.image = [UIImage imageNamed:@"assist_gray.png"];
    image_Assist.layer.masksToBounds = YES;
    [self.view_bottom addSubview:image_Assist];
    
    UILabel * lbl_Assist = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(image_Assist.frame) + 8, 15, 40, 20)];
    lbl_Assist.text = @"赞";
    lbl_Assist.textColor = [UIColor grayColor];
    lbl_Assist.font = [UIFont systemFontOfSize:15.0f];
    [self.view_bottom addSubview:lbl_Assist];
    
    UIView * line_Assist = [[UIView alloc] initWithFrame:CGRectMake(length_x * 2, 15, 0.7, 23)];
    line_Assist.backgroundColor = [UIColor grayColor];
    line_Assist.alpha = 0.4f;
    [self.view_bottom addSubview:line_Assist];
    
    UIButton * btn_Assist = [UIButton buttonWithType:(UIButtonTypeCustom)];
    btn_Assist.frame = CGRectMake(length_x, 0, length_x, 49);
    [self.view_bottom addSubview:btn_Assist];
    [btn_Assist addTarget:self action:@selector(btn_AssistAction:) forControlEvents:(UIControlEventTouchUpInside)];
    
    //转发
    UIImageView * image_Transmit = [[UIImageView alloc] initWithFrame:CGRectMake(length_x * 2 + length_x / 5, 15, 20, 20)];
    image_Transmit.image = [UIImage imageNamed:@"transmit_gray.png"];
    image_Transmit.layer.masksToBounds = YES;
    [self.view_bottom addSubview:image_Transmit];
    
    UILabel * lbl_Transmit = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(image_Transmit.frame) + 5, 15, 40, 20)];
    lbl_Transmit.text = @"转发";
    lbl_Transmit.textColor = [UIColor grayColor];
    lbl_Transmit.font = [UIFont systemFontOfSize:15.0f];
    [self.view_bottom addSubview:lbl_Transmit];
    
    UIView * line_Transmit = [[UIView alloc] initWithFrame:CGRectMake(length_x * 3, 15, 0.7, 23)];
    line_Transmit.backgroundColor = [UIColor grayColor];
    line_Transmit.alpha = 0.4f;
    [self.view_bottom addSubview:line_Transmit];
    
    UIButton * btn_Transmit = [UIButton buttonWithType:(UIButtonTypeCustom)];
    btn_Transmit.frame = CGRectMake(length_x * 2, 0, length_x, 49);
    [self.view_bottom addSubview:btn_Transmit];
    [btn_Transmit addTarget:self action:@selector(btn_TransmitAction:) forControlEvents:(UIControlEventTouchUpInside)];
    
    //更多
    UIImageView * image_More = [[UIImageView alloc] initWithFrame:CGRectMake(length_x * 3 + length_x / 2 - 10, 15, 20, 20)];
    image_More.image = [UIImage imageNamed:@"more_gray.png"];
    image_More.layer.masksToBounds = YES;
    [self.view_bottom addSubview:image_More];
        
    UIButton * btn_More = [UIButton buttonWithType:(UIButtonTypeCustom)];
    btn_More.frame = CGRectMake(length_x * 3, 0, length_x, 49);
    [self.view_bottom addSubview:btn_More];
    [btn_More addTarget:self action:@selector(btn_MoreAction:) forControlEvents:(UIControlEventTouchUpInside)];
}

#pragma mark - 点击回复
- (void )btn_ReplyAction:(UIButton *)sender
{
    NSLog(@"点击回复");
}

#pragma mark - 点击赞
- (void )btn_AssistAction:(UIButton *)sender
{
    NSLog(@"点击赞");
}

#pragma mark - 点击转发
- (void )btn_TransmitAction:(UIButton *)sender
{
    NSLog(@"点击转发");
}

#pragma mark - 点击更多
- (void )btn_MoreAction:(UIButton *)sender
{
    NSLog(@"点击更多");
}


#pragma mark - 点击进入个人资料  **********************************
- (void )btn_userAction:(UIButton *)sender
{
    //    NSLog(@"点击进入个人资料");
    
    Personal_InformationViewController * personal_InformationViewController = [[Personal_InformationViewController alloc] init];
    [self showViewController:personal_InformationViewController sender:nil];
}

#pragma mark - 点击进入参与人列表
- (void )btn_presonAction:(UIButton *)sender
{
//    NSLog(@"点击进入参与人列表");
    
    Person_listViewController * person_listViewController = [[Person_listViewController alloc] init];
    [self showViewController:person_listViewController sender:nil];
}

#pragma mark - 点击进入时间列表
- (void )btn_dateAction:(UIButton *)sender
{
    NSLog(@"点击进入时间列表");
}

#pragma mark - 点击进入提醒列表
- (void )btn_remindAction:(UIButton *)sender
{
//    NSLog(@"点击进入提醒列表");
    
    Date_listViewController * date_listViewController = [[Date_listViewController alloc] init];
    [self showViewController:date_listViewController sender:nil];
}




@end
